import java.awt.event.ItemEvent;
import java.awt.event.ItemListener;
import java.io.IOException;

public class JGI_Itemlistener implements ItemListener
{

	JAPI_SocketOutputStream JGI_actionstream;
	int JGI_id;		
	int debuglevel=0;	
	
	public JGI_Itemlistener(int object_id,  JAPI_SocketOutputStream action )
	{
		JGI_actionstream=action;
		JGI_id = object_id;	
	}
	
	public void itemStateChanged(ItemEvent e) 
	{
		if(debuglevel > 1) System.out.println("Item Event in Object : "+this.JGI_id);	
		try
		{	
			JGI_actionstream.sendInt(JGI_id);
		}
		catch(IOException exce) {}
	}
	
	public void setdebuglevel(int level)
	{
		debuglevel=level;
	}
}